This invention relates to a method for restricting total code volume in data-compression.
An enormous volume of memory is necessary for storing digital data of a picture signal in a magnetic disk, or in a CD-ROM. Therefore, in order to store many frames of pictures in a limited range of memory volume, some kind of high efficient data-compression is necessary. And, in recording a moving picture in a digital VTR, or in a digital moving picture file, a predetermined number of frames must be recorded in a predetermined memory volume independent of data volume contained in each frame. And, time required for recording and reproducing of a frame of a moving picture must be short and invariable.
For these purposes, it is necessary in data-compression to keep total code volume of a frame of a moving picture within a predetermined target code volume.
As for a data-compression of high efficiency, there is MPEG system wherein two dimensional orthogonal transform and variable length coding are combined.
The MPEG system which is developed by moving picture expert group in ISO, is briefly described in connection with FIG. 7.
The input is a picture data, composed of, for example, 352.times.288 pixel data. In step 1, the input is divided to blocks of equal size, for example, each block being composed of 8.times.8 pixels. In step 2, each block is transformed through a two dimensional DCT (discrete cosine transform, and in a general term, an orthogonal transform). Coefficients of frequency components obtained by the DCT are quantized (step 3).
Quantized coefficients are stored in a memory, for example, shown by FIG. 5. The memory of FIG. 5 has 8 X-address from X0 to X7, and 8 Y-address from Y0 to Y7. The DC component (or the mean value of pixel data of the block) is stored at (X0, Y0), The fundamental frequency component in X direction is stored at (X1, Y0), and the fundamental frequency component in Y direction is stored at (X0, Y1). Thus, as shown by a zigzag line in FIG. 5, starting from a DC component at (X0, Y0), the frequency of a component whose coefficient is stored at an address becomes higher as the zigzag line advances.
In step 4 of FIG. 7, Huffman coding (in a general term, a variable length coding) is operated on data stored in the memory shown by FIG. 5. In this coding, the DC component stored at (X0, Y0) is coded by differences between DC components of neighboring blocks. AC components are scanned on the zigzag line as shown in FIG. 5, and Huffman coding is operated.
As a prior art of this invention, wherein a data-compression as MPEG system is employed for data-compression of a picture data, restricting total code volume within a target code volume, there is a Japanese patent application entitled "An apparatus for data-compression and coding of a picture" and laid open as a provisional publication No. 343578/'92.
In the apparatus of the prior art, quantization step Q is determined before data compression, total generated code volume is obtained in a first run of data-compression, and in a second run of data-compression, data coding is so discontinued in a block as to restrict total generated code volume of the block within a code volume allotted to the block.
Since the apparatus of the prior art is designed for processing a frame of a picture as a unit, when the apparatus is used for processing a moving picture including a plural number of frames, there arises a problem wherein difference between actually generated code volume and the target code volume of a frame is integrated for each frame. And, since the quantization step Q is determined for each frame in the apparatus of the prior art, when a moving picture is processed by the apparatus, there arises a problem that data-compression and data-expansion require a large amount of processing time.